<template>
  <div>
  <van-tabbar v-model="active"  :route="true">
  <van-tabbar-item icon="home-o" to="/home">home</van-tabbar-item>
  <van-tabbar-item icon="shopping-cart-o" to="/cart">cart</van-tabbar-item>
  <van-tabbar-item icon="friends-o" :to="computedpath">{{ computedContent }}</van-tabbar-item>
</van-tabbar>
  </div>
</template>

<script setup lang="ts">
import {useuserstore}from "../store/userstore"
import{ref,computed} from 'vue'
let usestore =useuserstore()
// 根据token 中的用户的信息判断当前用户的登录状态
const computedpath = computed(() => {
    return localStorage.getItem("token") ? '/user' : '/login'
})
// 根据token 中的用户的信息判断当前用户的登录状态
const computedContent = computed(() => {
    return localStorage.getItem("token") ? 'user' : 'login'
})
let active=ref(0)

</script>
<style scoped>

</style>